import java.util.Scanner;

//除2! --> 输入n 个数,数组中共用一个k 可以让数组内任意元素除2,一共最多除k次,最后得到数组和要最小
public class test3 {
    public static void main(String[] args) {
        //每次找最大的偶数除
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int[] arr = new int[n];
        int max = 0;//找最大的偶数
        int sum = 0;
        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }
        for (int j = 0; j < k; j++) {
            max = Integer.MIN_VALUE;
            int flag=-1;
            for (int i = 0; i < arr.length; i++) {
                if(max<arr[i]&&arr[i]%2==0){
                    max=arr[i];
                    flag=i;
                }
            }
            if(flag==-1){
                break;
            }
            arr[flag] /=2;
        }
        for (int i = 0; i <arr.length ; i++) {
            sum+=arr[i];
        }
        System.out.println(sum);
    }
}
